﻿////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// <copyright>Copyright 2008-2011 Andreas Huber Doenni</copyright>
// Distributed under the Microsoft Public License (Ms-PL).
// See accompanying file License.txt or copy at http://mews.codeplex.com/license.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

namespace Mews.Mime
{
    /// <summary>Exposes information about the reason for body fallback.</summary>
    /// <remarks>A body fallback occurs when the Content-Transfer-Encoding and/or Content-Type header fields contain
    /// non-standard or unrecognized values or when required parameters are missing. Under these circumstances, the
    /// entity body cannot be represented accurately with the types exposed by this library.</remarks>
    /// <threadsafety static="true" instance="false"/>
    public sealed class FallbackReason
    {
        private readonly FallbackReasonKind kind;
        private readonly string data;

        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>Gets the fallback reason kind.</summary>
        public FallbackReasonKind Kind
        {
            get { return this.kind; }
        }

        /// <summary>Gets additional data about the fallback, always all-lowercase.</summary>
        public string Data
        {
            get { return this.data; }
        }

        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        internal FallbackReason(FallbackReasonKind kind, string data)
        {
            this.kind = kind;
            this.data = data;
        }
    }
}
